package com.innovationhero.main.client.UX;

import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;

// to be extracted from IdeaUX
public class IdeaBar 
extends Widget
{
	public IdeaBar(String txtURI, String imgURI, String audioURI, String videoURI){
		RootPanel rootPanel = RootPanel.get("IdeaBar");

		rootPanel.add(IdeaBar(txtURI,imgURI,audioURI, videoURI));
		
	}
	
	public Widget IdeaBar(String txtURI, String imgURI, String audioURI, String videoURI)
	{
		 final HorizontalPanel ideaBar = new HorizontalPanel();
		 ideaBar.add(ideaVideo(videoURI));
		 // ideaBar.add(ideaVideo("http://video.ted.com/talks/podcast/TimBerners-Lee_2009.mp4"));
		return ideaBar;
	}
	
	public Widget ideaVideo(String ideaVideoURI){
		final HTML ideaVideoHTML5;
		//String ideaVideoURI = ideaVideoURI;
			// "http://video.ted.com/talks/podcast/MattRidley_2010G.mp4";
		ideaVideoHTML5 = new HTML();
		ideaVideoHTML5.setHTML("<video width='400'" +
				"height='240'" +
				"controls='controls'>" +
		//"<source src='movie.ogg' type='video/ogg' />" +
		"<source src='" + ideaVideoURI + "' type='video/mp4' />" +
		//"<source src='movie.webm' type='video/webm' />" +
		"Your browser does not support the video tag." +
		"</video>");

		return ideaVideoHTML5; 
		}
}
